<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            display: flex;
            justify-content: space-around;
            align-items: flex-end;
            margin:100px auto;
            width: 400px;
            height: 300px;
            border-left:  1px solid pink;
            border-bottom: 1px solid pink;
        }
        .box>div{
            position: relative;
            width: 50px;
            height: 100px;
            background-color: pink;
        }
         .box>div>span{
            position: absolute;
            width: 50px;
            top:-25px;
            text-align: center;
         }
        .box>div>p{
            position: absolute;
            width: 80px;
            bottom: -35px;
            left:-15px;
          text-align: center;
      
        }

    </style>
</head>
<body>   
    <script>
        let arr=[];
        for(let i=0;i<4;i++){
            let num=+prompt(`请输入第${i+1}季度`)
            arr.push(num);
        }
        console.log(arr)

        let content ='<div class="box">';
        
            for(let j=0;j<4;j++){
                content+=`
                <div style='height:${arr[j]}px'>
                    <span>${arr[j]}</span>
                    <p>第${j+1}季度</p>
                    </div>
                    `;
                    }
                    content+='</div>';
                        document.write( content);
                       
    </script>
</body>
</html>